package com.itheima.itheima_health.mapper;

import com.github.pagehelper.Page;
import com.itheima.itheima_health.entity.QueryPageBean;
import com.itheima.itheima_health.pojo.Setmeal;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface CheckMenuMapper {

    Page<Setmeal> MenuPageQuery(QueryPageBean queryPageBean);

    void MenuAdd(Setmeal setmeal);

    void AddMenuOfthechcheckgroup(Integer[] checkgroupIds, Integer menuId);

    @Select("select * from t_setmeal where id = #{id}")
    Setmeal findById(Integer id);
    @Select("select checkgroup_id from t_setmeal_checkgroup where setmeal_id = #{id}")
    Integer[] findSetmealOftheCheckgroup(Integer id);
    @Delete("delete from t_setmeal where id = #{id}")
    void delete(Integer id);

    @Delete("delete from t_setmeal_checkgroup where setmeal_id = #{setmealId}")
    void deleteSetmealOfthecheckgroup(Integer setmealId);

    void update(Setmeal setmeal);
}
